<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>15_键盘事件-获取鼠标焦点事件-onfocus</title>
    </head>
    <body>
        <input type="text">

        <script>
            var inp = document.querySelector('input');

            inp.onfocus = function(){
                console.log(11111);
            }
        </script>
    </body>
</html>